<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="checkbox" value="密码">
    <button>按钮</button>
    <script>
        const inp = document.querySelector('input');
        // inp.type = 'password';
        // inp.checked = true;
        // console.log(inp.checked);
        inp.disabled = true;
        const button = document.querySelector('input');
        // button.disabled 接收的是布尔型的值
        // 必须用true 而不是字符串'true'
        // button.disabled = true;
        button.disabled = 'true';
    </script>
</body>

</html>